home *** CD-ROM | disk | FTP | other *** search
/ Champak 130 / Vol 130.iso / games / sushi_re.swf / scripts / DefineSprite_157 / frame_1 / DoAction.as
Encoding:
Text File  |  2008-09-22  |  20.3 KB  |  806 lines

  1. function BallXY(MC)
  2. {
  3.    d = this.radius - MC.r / 360 * 50;
  4.    var _loc3_ = MC.r * 3.141592653589793 / 180;
  5.    MC._x = d * Math.cos(_loc3_) + this.centerX;
  6.    MC._y = d * Math.sin(_loc3_) + this.centerY;
  7.    if(MC.r > this.maxRotation)
  8.    {
  9.       MC.removeMovieClip();
  10.    }
  11. }
  12. function distanceMC(MC1, MC2)
  13. {
  14.    if(MC1 != undefined && MC2 != undefined)
  15.    {
  16.       var _loc2_ = MC1._x - MC2._x;
  17.       var _loc1_ = MC1._y - MC2._y;
  18.       return Math.sqrt(_loc2_ * _loc2_ + _loc1_ * _loc1_);
  19.    }
  20.    return 1000;
  21. }
  22. function rotationMC(MC)
  23. {
  24.    var _loc3_ = MC._x - centerX;
  25.    var _loc2_ = MC._y - centerY;
  26.    var _loc1_ = Math.atan2(_loc2_,_loc3_) * 180 / 3.141592653589793;
  27.    if(_loc1_ < 0)
  28.    {
  29.       return 360 + _loc1_;
  30.    }
  31.    return _loc1_;
  32. }
  33. function rotationXY(x1, y1, x2, y2)
  34. {
  35.    var _loc3_ = x1 - x2;
  36.    var _loc2_ = y1 - y2;
  37.    var _loc1_ = Math.atan2(_loc2_,_loc3_) * 180 / 3.141592653589793;
  38.    if(_loc1_ < 0)
  39.    {
  40.       return 360 + _loc1_;
  41.    }
  42.    return _loc1_;
  43. }
  44. function MouseLine()
  45. {
  46.    var _loc3_ = this.rotationXY(_parent._xmouse,_parent._ymouse,this.lineMC._x,this.lineMC._y);
  47.    this.lineMC._rotation = _loc3_;
  48.    if(_loc3_ < 0)
  49.    {
  50.       _loc3_ += 360;
  51.    }
  52.    this.lineMC.BOX._x = this.radius - _loc3_ / 360 * 50 + this.ballRadius / 2;
  53. }
  54. function unSet()
  55. {
  56.    this.gameplay = false;
  57.    if(_parent.GAMEOVER != undefined)
  58.    {
  59.       _parent.GAMEOVER.removeMovieClip();
  60.    }
  61.    var _loc3_ = this.prevMC;
  62.    while(true)
  63.    {
  64.       if(_loc3_.prevMC == undefined)
  65.       {
  66.          _loc3_.removeMovieClip();
  67.          break;
  68.       }
  69.       _loc3_ = _loc3_.prevMC;
  70.       _loc3_.nextMC.removeMovieClip();
  71.    }
  72.    this.prevMC = undefined;
  73.    this.centerMC.removeMovieClip();
  74.    this.centerTmp.removeMovieClip();
  75.    this.screwTmp.removeMovieClip();
  76.    this.centerMC = undefined;
  77.    this.centerTmp = undefined;
  78.    this.screwTmp = undefined;
  79.    stopAllSounds();
  80. }
  81. function GameStart()
  82. {
  83.    this.Setup();
  84. }
  85. function Setup()
  86. {
  87.    this.unSet();
  88.    var _loc3_ = 0;
  89.    var _loc2_ = 0;
  90.    while(_loc2_ < 20000)
  91.    {
  92.       d = this.radius - _loc3_ / 360 * this.maxDistance;
  93.       _loc3_ += Math.atan2(1,d) * 180 / 3.141592653589793;
  94.       var _loc4_ = _loc3_ * 3.141592653589793 / 180;
  95.       var _loc6_ = Math.round((d * Math.cos(_loc4_) + this.centerX) * 10) / 10;
  96.       var _loc5_ = Math.round((d * Math.sin(_loc4_) + this.centerY) * 10) / 10;
  97.       this.circleXY[_loc2_] = [_loc6_,_loc5_];
  98.       if(_loc3_ > this.maxRotation)
  99.       {
  100.          break;
  101.       }
  102.       _loc2_ = _loc2_ + 1;
  103.    }
  104.    this.centerTmp = this.gameMC.attachMovie(this.ballName,"centerTmp",this.Depths);
  105.    this.centerTmp._x = this.gameMC[this.centerName]._x;
  106.    this.centerTmp._y = this.gameMC[this.centerName]._y;
  107.    this.centerTmp.gotoAndStop(this.AddBallFrame());
  108.    this.screwTmp = this.gameMC.attachMovie(this.ballName,"screwTmp",this.Depths + 1);
  109.    this.screwTmp._x = this.gameMC[this.nextName]._x;
  110.    this.screwTmp._y = this.gameMC[this.nextName]._y;
  111.    this.screwTmp.gotoAndStop(this.AddBallFrame());
  112.    this.lineMC._x = this.centerX;
  113.    this.lineMC._y = this.centerY;
  114.    this.lineMC.swapDepths(this.Depths + this.Bmax + 2);
  115.    this.slotMC.tx = this.slotMC._x;
  116.    this.slotMC.ty = this.slotMC._y;
  117.    this.slotMC.swapDepths(this.Depths + this.Bmax + 3);
  118.    this.gameMC.HELP.swapDepths(this.Depths + this.Bmax + 4);
  119.    this.gameMC.PAUSE.swapDepths(this.Depths + this.Bmax + 5);
  120.    this.shoot = false;
  121.    this.shootMove = 0;
  122.    this.Bnum = 1;
  123.    this.comboNum = 0;
  124.    this.maxCombo = 0;
  125.    this.TotalScore = 0;
  126.    this.CountBall = 0;
  127.    this.displayScore();
  128.    this.gameplay = true;
  129.    this.soundPlay("title",1);
  130.    this.startMC.gotoAndStop("OFF");
  131.    this.startTime = getTimer();
  132.    if(this._visible == true)
  133.    {
  134.       this._visible = false;
  135.    }
  136. }
  137. function GameOver()
  138. {
  139.    this.gameplay = false;
  140.    var _loc3_ = Math.floor((getTimer() - this.startTime) / 1000);
  141.    trace("play_time - " + _loc3_);
  142.    if(_root.uid == undefined || _root.ot1 == undefined || this.TotalScore <= 0 || this.TotalScore == undefined || _loc3_ <= 0 || _loc3_ == undefined)
  143.    {
  144.       trace("∞₧ÿδ¬╗δÉ£ Ω░Æ∞¥┤ δôñ∞û┤∞ÿ┤ this.TotalScore : " + this.TotalScore + "play_time:" + _loc3_ + " this.startTime" + this.startTime);
  145.       gameRankView();
  146.    }
  147.    else
  148.    {
  149.       trace("δ₧¡φé╣∞ù░Ω▓░");
  150.       this._parent.scoreSendDB(_root.ot1,_root.uid,this.TotalScore,_loc3_);
  151.    }
  152. }
  153. function gameRankView(nickName, rankNum)
  154. {
  155.    if(!nickName)
  156.    {
  157.       var _loc3_ = _parent.attachMovie(this.gameoverName,"GAMEOVER",this.Depths + 20001);
  158.       _loc3_._x = this.centerX;
  159.       _loc3_._y = this.centerY;
  160.       _loc3_._visible = true;
  161.       this.startMC._y = _loc3_._y + 100;
  162.       this.startMC.gotoAndStop("ON");
  163.    }
  164.    else
  165.    {
  166.       _loc3_ = _parent.attachMovie(this.gameoverRank,"GAMEOVER",this.Depths + 20001);
  167.       _loc3_._x = this.centerX - 100;
  168.       _loc3_._y = this.centerY;
  169.       _loc3_._visible = true;
  170.       _loc3_.my_nickName = nickName;
  171.       _loc3_.my_score = this.TotalScore;
  172.       _loc3_.my_gameRank = rankNum;
  173.    }
  174.    this.soundPlay("title",1);
  175. }
  176. function AddBallFrame()
  177. {
  178.    var _loc4_ = 0;
  179.    if(random(lightningRand) == 0)
  180.    {
  181.       _loc4_ = lightningFrame;
  182.    }
  183.    else
  184.    {
  185.       var _loc3_ = this.ballMaxCount;
  186.       var _loc2_ = 0;
  187.       while(_loc2_ < this.ballMaxArr.length)
  188.       {
  189.          if(this.ballMaxArr[_loc2_] > this.CountBall)
  190.          {
  191.             _loc3_ = _loc2_ + this.ballMaxMin;
  192.             break;
  193.          }
  194.          _loc2_ = _loc2_ + 1;
  195.       }
  196.       if(_loc3_ > this.ballMaxCount)
  197.       {
  198.          _loc3_ = this.ballMaxCount;
  199.       }
  200.       _loc4_ = random(_loc3_) + 1;
  201.       this.ballMaxNum = _loc3_;
  202.    }
  203.    return _loc4_;
  204. }
  205. function AddBall(mv)
  206. {
  207.    var _loc3_ = this.gameMC.attachMovie(this.ballName,"B" + this.Bnum,this.Bnum + this.Depths + 2);
  208.    _loc3_.Bnum = this.Bnum;
  209.    this.Bnum = this.Bnum + 1;
  210.    if(this.Bnum >= this.Bmax)
  211.    {
  212.       this.Bnum = 1;
  213.    }
  214.    _loc3_.num = -10;
  215.    _loc3_.mv = mv;
  216.    _loc3_.prevMC = undefined;
  217.    _loc3_.nextMC = undefined;
  218.    if(mv == 0)
  219.    {
  220.       _loc3_._x = this.centerX;
  221.       _loc3_._y = this.centerY;
  222.    }
  223.    else
  224.    {
  225.       _loc3_._x = _parent.AS.circleXY[_loc3_.num][0];
  226.       _loc3_._y = _parent.AS.circleXY[_loc3_.num][1];
  227.    }
  228.    _loc3_.gotoAndStop(this.AddBallFrame());
  229.    return _loc3_;
  230. }
  231. function AddCenterBall()
  232. {
  233.    var _loc2_ = this.AddBall(0);
  234.    _loc2_.swapDepths(this.Depths + this.Bmax + 1);
  235.    this.centerMC = _loc2_;
  236.    this.shoot = false;
  237.    _loc2_.gotoAndStop(this.centerTmp._currentframe);
  238.    this.centerTmp.gotoAndStop(this.AddBallFrame());
  239. }
  240. function AddScrewBall()
  241. {
  242.    var _loc2_ = this.AddBall(1);
  243.    if(this.prevMC != undefined)
  244.    {
  245.       _loc2_.prevMC = this.prevMC;
  246.       this.prevMC.nextMC = _loc2_;
  247.    }
  248.    this.prevMC = _loc2_;
  249.    _loc2_.gotoAndStop(this.screwTmp._currentframe);
  250.    this.screwTmp.gotoAndStop(this.AddBallFrame());
  251. }
  252. function displayScore()
  253. {
  254.    _parent.scoreMC.TXT = this.TotalScore;
  255. }
  256. function deleteBall(tMC, score)
  257. {
  258.    if(tMC != undefined)
  259.    {
  260.       if(tMC.prevMC != undefined)
  261.       {
  262.          tMC.prevMC.nextMC = tMC.nextMC;
  263.       }
  264.       if(tMC.nextMC != undefined)
  265.       {
  266.          tMC.nextMC.prevMC = tMC.prevMC;
  267.       }
  268.       else
  269.       {
  270.          this.prevMC = tMC.prevMC;
  271.          tMC.prevMC.nextMC = undefined;
  272.       }
  273.       if(score > 0)
  274.       {
  275.          this.CountBall = this.CountBall + 1;
  276.          var _loc3_ = this.gameMC.attachMovie(this.boxName,"box" + tMC.Bnum,this.Depths + tMC.Bnum + 5000);
  277.          _loc3_._x = tMC._x;
  278.          _loc3_._y = tMC._y;
  279.          _loc3_.TXT = score;
  280.          this.TotalScore += score;
  281.          this.displayScore();
  282.       }
  283.       tMC.removeMovieClip();
  284.    }
  285. }
  286. function insertBall(tMC)
  287. {
  288.    if(tMC != undefined)
  289.    {
  290.       var _loc3_ = this.rotationMC(tMC);
  291.       if(_loc3_ < this.shootRotation)
  292.       {
  293.          this.centerMC.num = tMC.num + this.ballRadius;
  294.          this.centerMC.prevMC = tMC.prevMC;
  295.          this.centerMC.nextMC = tMC;
  296.          if(tMC.prevMC != undefined)
  297.          {
  298.             tMC.prevMC.nextMC = this.centerMC;
  299.          }
  300.          tMC.prevMC = this.centerMC;
  301.       }
  302.       else
  303.       {
  304.          this.centerMC.num = tMC.num - this.ballRadius;
  305.          this.centerMC.prevMC = tMC;
  306.          this.centerMC.nextMC = tMC.nextMC;
  307.          if(tMC.nextMC != undefined)
  308.          {
  309.             tMC.nextMC.prevMC = this.centerMC;
  310.          }
  311.          else
  312.          {
  313.             this.prevMC = this.centerMC;
  314.          }
  315.          tMC.nextMC = this.centerMC;
  316.       }
  317.       this.centerMC.swapDepths(this.centerMC.Bnum + this.Depths);
  318.    }
  319. }
  320. function getSameBall(cMC, ops)
  321. {
  322.    var _loc4_ = 1;
  323.    var _loc5_ = cMC._currentframe;
  324.    var _loc2_ = cMC;
  325.    while(_loc2_.prevMC != undefined)
  326.    {
  327.       if(_loc2_.prevMC._currentframe != _loc5_)
  328.       {
  329.          break;
  330.       }
  331.       if(!(ops == 1 || _loc2_.prevMC.num - _loc2_.num <= this.ballRadius))
  332.       {
  333.          break;
  334.       }
  335.       _loc2_ = _loc2_.prevMC;
  336.       _loc4_ = _loc4_ + 1;
  337.    }
  338.    var _loc3_ = cMC.nextMC;
  339.    while(_loc3_ != undefined)
  340.    {
  341.       if(_loc3_._currentframe != _loc5_)
  342.       {
  343.          break;
  344.       }
  345.       if(!(ops == 1 || _loc3_.prevMC.num - _loc3_.num <= this.ballRadius))
  346.       {
  347.          break;
  348.       }
  349.       _loc3_ = _loc3_.nextMC;
  350.       _loc4_ = _loc4_ + 1;
  351.    }
  352.    if(_loc4_ >= 3)
  353.    {
  354.       return _loc2_;
  355.    }
  356.    return undefined;
  357. }
  358. function sameDeleteBall(tMC)
  359. {
  360.    if(tMC.prevMC != undefined)
  361.    {
  362.       tMC.prevMC.mv = 0;
  363.    }
  364.    if(this.comboMC == undefined)
  365.    {
  366.       this.comboNum = 1;
  367.    }
  368.    else
  369.    {
  370.       this.comboNum = this.comboNum + 1;
  371.       if(this.comboNum > this.maxCombo)
  372.       {
  373.          this.maxCombo = this.comboNum;
  374.       }
  375.    }
  376.    var _loc4_ = this.comboNum * this.comboNum;
  377.    if(_loc4_ < 2)
  378.    {
  379.       _loc4_ = 2;
  380.    }
  381.    var _loc5_ = tMC._currentframe;
  382.    while(tMC != undefined)
  383.    {
  384.       if(tMC._currentframe != _loc5_)
  385.       {
  386.          break;
  387.       }
  388.       var _loc2_ = tMC;
  389.       tMC = tMC.nextMC;
  390.       if(_loc2_.num - _loc2_.nextMC.num > this.ballRadius)
  391.       {
  392.          this.deleteBall(_loc2_,_loc4_);
  393.          break;
  394.       }
  395.       this.deleteBall(_loc2_,_loc4_);
  396.    }
  397.    this.soundPlay("explore",1);
  398. }
  399. function colorDeleteBall(Fnum)
  400. {
  401.    var _loc3_ = this.prevMC;
  402.    while(true)
  403.    {
  404.       if(_loc3_ == undefined)
  405.       {
  406.          break;
  407.       }
  408.       var _loc2_ = _loc3_;
  409.       _loc3_ = _loc3_.prevMC;
  410.       if(_loc2_._currentframe == Fnum)
  411.       {
  412.          this.deleteBall(_loc2_,1);
  413.          _loc2_.mv = 0;
  414.       }
  415.    }
  416. }
  417. function moveHitBall()
  418. {
  419.    if(this.prevMC != undefined)
  420.    {
  421.       var _loc3_ = undefined;
  422.       var _loc2_ = this.prevMC;
  423.       while(true)
  424.       {
  425.          var _loc4_ = this.distanceMC(this.centerMC,_loc2_);
  426.          if(_loc4_ <= this.ballRadius)
  427.          {
  428.             if(_loc3_ != undefined && _loc4_ < this.distanceMC(this.centerMC,_loc3_))
  429.             {
  430.                _loc3_ = _loc2_;
  431.             }
  432.             else
  433.             {
  434.                _loc3_ = _loc2_;
  435.             }
  436.          }
  437.          if(_loc2_.prevMC == undefined)
  438.          {
  439.             break;
  440.          }
  441.          _loc2_ = _loc2_.prevMC;
  442.       }
  443.       if(_loc3_ != undefined)
  444.       {
  445.          this.insertBall(_loc3_);
  446.          if(this.centerMC._currentframe == this.lightningFrame && _loc3_._currentframe == this.lightningFrame)
  447.          {
  448.             this.deleteBall(this.centerMC,0);
  449.             this.deleteBall(_loc3_,0);
  450.             this.soundPlay("bomb",1);
  451.          }
  452.          else if(this.centerMC._currentframe == this.lightningFrame)
  453.          {
  454.             this.deleteBall(this.centerMC,0);
  455.             this.colorDeleteBall(_loc3_._currentframe);
  456.             this.soundPlay("bomb",1);
  457.          }
  458.          else if(_loc3_._currentframe == this.lightningFrame)
  459.          {
  460.             this.deleteBall(_loc3_,0);
  461.             this.colorDeleteBall(this.centerMC._currentframe);
  462.             this.soundPlay("bomb",1);
  463.          }
  464.          else
  465.          {
  466.             this.comboNum = 1;
  467.             var _loc5_ = this.getSameBall(this.centerMC,0);
  468.             if(_loc5_ != undefined)
  469.             {
  470.                var _loc6_ = _loc5_.prevMC;
  471.                this.sameDeleteBall(_loc5_);
  472.                if(_loc6_ != undefined)
  473.                {
  474.                   this.getComboBall(_loc6_);
  475.                }
  476.             }
  477.          }
  478.          this.centerMC = undefined;
  479.          _loc3_ = undefined;
  480.       }
  481.    }
  482. }
  483. function moveCenterBall()
  484. {
  485.    this.shootMove += this.shootSpeed;
  486.    var _loc2_ = this.shootRotation * 3.141592653589793 / 180;
  487.    this.centerMC._x = this.shootMove * Math.cos(_loc2_) + this.centerX;
  488.    this.centerMC._y = this.shootMove * Math.sin(_loc2_) + this.centerY;
  489.    var _loc3_ = this.radius - this.shootRotation / 360 * 50;
  490.    if(this.shootMove > _loc3_)
  491.    {
  492.       this.centerMC.removeMovieClip();
  493.       this.centerMC = undefined;
  494.    }
  495.    else
  496.    {
  497.       this.moveHitBall();
  498.    }
  499. }
  500. function moveScrewBall()
  501. {
  502.    var _loc2_ = this.prevMC;
  503.    if(_loc2_.num < this.ballRadius)
  504.    {
  505.       _loc2_.num = _loc2_.num + 1;
  506.    }
  507.    while(true)
  508.    {
  509.       if(_loc2_.prevMC != undefined)
  510.       {
  511.          if(_loc2_.prevMC.num - _loc2_.num <= this.ballRadius)
  512.          {
  513.             _loc2_.prevMC.num = _loc2_.num + this.ballRadius;
  514.          }
  515.       }
  516.       if(_loc2_.num >= this.circleXY.length)
  517.       {
  518.          this.GameOver();
  519.          break;
  520.       }
  521.       if(_loc2_.num < 0)
  522.       {
  523.          _loc2_._x = this.circleXY[0][0];
  524.          _loc2_._y = this.circleXY[0][1] + _loc2_.num * 7;
  525.          this.slotMC._y = this.slotMC.ty + _loc2_.num;
  526.       }
  527.       else
  528.       {
  529.          _loc2_._x = this.circleXY[_loc2_.num][0];
  530.          _loc2_._y = this.circleXY[_loc2_.num][1];
  531.       }
  532.       if(_loc2_.prevMC == undefined)
  533.       {
  534.          break;
  535.       }
  536.       _loc2_ = _loc2_.prevMC;
  537.    }
  538. }
  539. function getComboBall(cMC)
  540. {
  541.    if(cMC != undefined && cMC.nextMC != undefined)
  542.    {
  543.       if(cMC._currentframe == cMC.nextMC._currentframe)
  544.       {
  545.          if(this.getSameBall(cMC,1) != undefined)
  546.          {
  547.             this.comboMC = cMC;
  548.             this.soundPlay("combo",1);
  549.          }
  550.       }
  551.    }
  552. }
  553. function moveComboBall()
  554. {
  555.    if(this.comboMC != undefined && this.comboMC.nextMC != undefined)
  556.    {
  557.       var _loc3_ = this.comboMC.num - this.comboMC.nextMC.num - this.ballRadius;
  558.       if(_loc3_ > this.backSpeed)
  559.       {
  560.          _loc3_ = this.backSpeed;
  561.       }
  562.       var _loc2_ = this.comboMC;
  563.       while(true)
  564.       {
  565.          _loc2_.num -= _loc3_;
  566.          _loc2_._x = this.circleXY[_loc2_.num][0];
  567.          _loc2_._y = this.circleXY[_loc2_.num][1];
  568.          if(_loc2_.prevMC == undefined)
  569.          {
  570.             break;
  571.          }
  572.          _loc2_ = _loc2_.prevMC;
  573.       }
  574.       if(_loc3_ <= 0)
  575.       {
  576.          var _loc4_ = this.getSameBall(this.comboMC,0);
  577.          if(_loc4_ != undefined)
  578.          {
  579.             var _loc5_ = _loc4_.prevMC;
  580.             this.sameDeleteBall(_loc4_);
  581.             if(_loc5_ != undefined)
  582.             {
  583.                this.getComboBall(_loc5_);
  584.             }
  585.          }
  586.          else
  587.          {
  588.             this.comboMC = undefined;
  589.          }
  590.       }
  591.    }
  592.    else
  593.    {
  594.       this.comboMC = undefined;
  595.    }
  596. }
  597. function helpOnOff()
  598. {
  599.    if(this.helpOn == true)
  600.    {
  601.       this.gameMC.HELP._visible = false;
  602.       this.helpMC.gotoAndStop("OFF");
  603.       this.helpOn = false;
  604.    }
  605.    else
  606.    {
  607.       this.gameMC.HELP._visible = true;
  608.       this.helpMC.gotoAndStop("ON");
  609.       this.helpOn = true;
  610.    }
  611. }
  612. function soundOnOff()
  613. {
  614.    if(this.soundOn == true)
  615.    {
  616.       this.soundMC.gotoAndStop("OFF");
  617.       this.soundOn = false;
  618.       stopAllSounds();
  619.    }
  620.    else
  621.    {
  622.       this.soundMC.gotoAndStop("ON");
  623.       this.soundOn = true;
  624.    }
  625. }
  626. function pauseOnOff()
  627. {
  628.    if(this.pauseOn == true)
  629.    {
  630.       this.gameMC.PAUSE._visible = false;
  631.       this.pauseMC.gotoAndStop("OFF");
  632.       this.pauseOn = false;
  633.    }
  634.    else
  635.    {
  636.       this.gameMC.PAUSE._visible = true;
  637.       this.pauseMC.gotoAndStop("ON");
  638.       this.pauseOn = true;
  639.    }
  640. }
  641. function soundPlay(name, loop)
  642. {
  643.    if(this.soundOn == true && this.gameVolume > 0)
  644.    {
  645.       this.soundObj[name].start(0,loop);
  646.       this.soundObj[name].setVolume(this.gameVolume);
  647.    }
  648. }
  649. function sendRankScore(score, score_play)
  650. {
  651.    if(_root.dbconnect == "yes")
  652.    {
  653.       sendObj = new LoadVars();
  654.       loadObj = new LoadVars();
  655.       sendObj.gametype = _root.gametype;
  656.       sendObj.userid = _root.userid;
  657.       sendObj.score = int(score) + 969696;
  658.       sendObj.score_play = score_play;
  659.       sendObj.sendAndLoad(_root.dir + "game_record." + _root.scripttype,loadObj,"POST");
  660.       loadObj.onLoad = function()
  661.       {
  662.       };
  663.    }
  664. }
  665. System.useCodepage = true;
  666. this._name = "AS";
  667. var gameMC = _parent.GAME;
  668. var startMC = _parent.STARTBUTTON;
  669. this.startMC.swapDepths(20001);
  670. var f = 0;
  671. var Bnum = 1;
  672. var Bmax = 10000;
  673. var Depths = 100;
  674. var circleXY = [];
  675. var centerTmp = undefined;
  676. var screwTmp = undefined;
  677. var centerMC = undefined;
  678. var shoot = false;
  679. var shootRotation = 0;
  680. var shootMove = 0;
  681. var shootSpeed = 15;
  682. var backSpeed = 8;
  683. var lineMC = this.gameMC.LINEMC;
  684. var slotMC = this.gameMC.SLOTMC;
  685. var prevMC = undefined;
  686. var comboMC = undefined;
  687. var comboNum = 0;
  688. var maxCombo = 0;
  689. var gameplay = false;
  690. var TotalScore = 0;
  691. var ballMaxNum = ballMaxMin = 4;
  692. var ballMaxCount = 9;
  693. var ballMaxArr = [30,500,1000,2000,3000,5000,10000,30000,50000];
  694. var lightningFrame = 10;
  695. var lightningRand = 180;
  696. var CountBall = 0;
  697. var maxRotation = 920;
  698. var maxDistance = 45;
  699. var HitAreaX1 = 10;
  700. var HitAreaY1 = 10;
  701. var HitAreaX2 = 410;
  702. var HitAreaX2 = 410;
  703. var startTime = 0;
  704. var test = false;
  705. this.onEnterFrame = function()
  706. {
  707.    var _loc5_ = false;
  708.    if(this.pauseOn == false && this.gameplay == true)
  709.    {
  710.       if(this.comboMC == undefined)
  711.       {
  712.          this.f += 1;
  713.          if(this.f >= this.ballRadius)
  714.          {
  715.             this.f = 0;
  716.             this.AddScrewBall();
  717.          }
  718.          this.MouseLine();
  719.          if(this.prevMC != undefined)
  720.          {
  721.             this.moveScrewBall();
  722.          }
  723.          if(this.shoot == true)
  724.          {
  725.             this.moveCenterBall();
  726.          }
  727.          if(this.centerMC == undefined)
  728.          {
  729.             this.AddCenterBall();
  730.          }
  731.          var _loc4_ = _parent._xmouse;
  732.          var _loc3_ = _parent._ymouse;
  733.          if(_loc4_ >= this.HitAreaX1 && _loc4_ <= this.HitAreaX2 && _loc3_ >= this.HitAreaY1 && _loc3_ <= this.HitAreaX2)
  734.          {
  735.             _loc5_ = true;
  736.          }
  737.       }
  738.       else
  739.       {
  740.          this.moveComboBall();
  741.       }
  742.    }
  743.    if(_loc5_)
  744.    {
  745.       this.lineMC.gotoAndStop(2);
  746.    }
  747.    else
  748.    {
  749.       this.lineMC.gotoAndStop(1);
  750.    }
  751.    if(this.test)
  752.    {
  753.       _parent.TXT = "ball: " + this.CountBall + ", combo: " + this.maxCombo + ", Kind: " + this.ballMaxNum;
  754.    }
  755. };
  756. this.onMouseDown = function()
  757. {
  758.    if(this.pauseOn == false && this.helpOn == false && this.gameplay == true && this.centerMC != undefined && this.shoot == false)
  759.    {
  760.       var _loc4_ = _parent._xmouse;
  761.       var _loc3_ = _parent._ymouse;
  762.       if(_loc4_ >= this.HitAreaX1 && _loc4_ <= this.HitAreaX2 && _loc3_ >= this.HitAreaY1 && _loc3_ <= this.HitAreaX2)
  763.       {
  764.          this.shootRotation = this.rotationXY(_loc4_,_loc3_,this.centerX,this.centerY);
  765.          this.shoot = true;
  766.          this.shootMove = 0;
  767.          this.soundPlay("shoot",1);
  768.       }
  769.    }
  770. };
  771. this.onUnload = function()
  772. {
  773.    this.unSet();
  774.    this.lineMC.removeMovieClip();
  775.    this.slotMC.removeMovieClip();
  776. };
  777. this.stop();
  778. var helpOn = false;
  779. var helpMC = _parent.helpMC;
  780. this.helpMC.gotoAndStop("OFF");
  781. this.gameMC.HELP._visible = false;
  782. var soundOn = true;
  783. var soundMC = _parent.soundMC;
  784. this.soundMC.gotoAndStop("ON");
  785. var pauseOn = false;
  786. var pauseMC = _parent.pauseMC;
  787. this.pauseMC.gotoAndStop("OFF");
  788. this.gameMC.PAUSE._visible = false;
  789. var soundName = ["title","shoot","explore","combo","bomb"];
  790. var soundObj = Array();
  791. if(this.gameVolume < 0)
  792. {
  793.    this.gameVolume = 0;
  794. }
  795. if(this.gameVolume > 1000)
  796. {
  797.    this.gameVolume = 1000;
  798. }
  799. var i = 0;
  800. while(i <= soundName.length)
  801. {
  802.    soundObj[soundName[i]] = new Sound();
  803.    soundObj[soundName[i]].attachSound(soundName[i]);
  804.    i++;
  805. }
  806.